package com.es.test.dto;

import com.es.test.document.Label;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author django
 * @date 2024/2/2
 * @description
 */
@Data
@AllArgsConstructor
public class LabelDto<T> {
    private String name;
    private String value;

    private T data;
    private String type;

    public LabelDto(String name, String value) {
        this.name = name;
        this.value = value;
    }

    public LabelDto(String name, String value, String type) {
        this.name = name;
        this.value = value;
        this.type = type;
    }

    public static LabelDto init(String name, String value, String type) {
        return new LabelDto(name, value, type);
    }

    public static LabelDto init(String name, String value) {
        return new LabelDto(name, value, "keyword");
    }

}
